﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<link href="../../Content/style.css" rel="stylesheet" type="text/css" />
</head>
<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        ListView1.DataSource = ViewData.Model;
        ListView1.DataBind();
    }
</script>
<body style="background:#e1d1d6;">
    <h2><%=Html.Encode(ViewData["title"]) %></h2>
    
    <table align="left" cellpadding="0" cellspacing="0" 
        style="width: 100%; float: left">
        <tr>
            <td>
            <asp:ListView ID="ListView1" runat="server">
                <ItemTemplate>
                    <div class="product_box">
                    <h3><%#Eval("TenSanPham")%></h3>
                    <div class="image_wrapper"> <a href="../../Admin/Detail/<%#Eval("MaSanPham")%>"><img src="<%#Eval("Hinh") %>" alt="" width="190px" height="108px" /></a> </div>
                    <p class="price">Price: <%#Eval("Gia")%></p>
                    <a href="../../Admin/Detail/<%#Eval("MaSanPham")%>" style="color:Black;font-weight:bold;">Detail</a> | <a href="../../Admin/EditProduct/<%#Eval("MaSanPham")%>" style="color:Black;font-weight:bold;">Edit</a> </div>        
                </ItemTemplate> 
            </asp:ListView>"
            </td>
        </tr>
        <tr>
            <td>
    <center><asp:DataPager ID="DataPager1" PageSize="9" QueryStringField="Page" PagedControlID="ListView1" runat="server">
        <Fields>
            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                ShowNextPageButton="False" ShowPreviousPageButton="False" />
            <asp:NumericPagerField />
            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                ShowNextPageButton="False" ShowPreviousPageButton="False" />
        </Fields>
    </asp:DataPager></center>
            </td>
        </tr>
    </table>
    <p style="text-align:right;"><a href="../../Admin/FormProduct/1" target="main_frame" style="color:Black;font-weight:bold;"><input type="button" id="submit_btn" value="Add Product" /></a></p>
</body>
</html>
